/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.hieptq.btvn1;

import java.util.Scanner;

/**
 *
 * @author Hiep
 */
public class Bai1Muc2 {
    public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		System.out.print("Nhap n: ");
		int n=sc.nextInt();
		int a[]=new int[100];
		System.out.print("Nhap mang gom "+n+" phan tu: ");
		for(int i=1;i<=n;i++)
			a[i]=sc.nextInt();
		for(int i=0;i<n;i++)
		for(int j=i+1;j<=n;j++)
			if(a[i]>a[j]){
				int t;
				t=a[i];
				a[i]=a[j];
				a[j]=t;
			}
	System.out.println("Day sau khi sap xep: ");
	for(int i=1;i<=n;i++)
		System.out.println(" "+a[i]);
		
	}

}
